package com.tianyu.service.tcp.send;

/**********************************
 * @Author YSW
 * @Description
 * @Date 2024/8/1 - 17:10
 **********************************/

public class WaylineFlight implements TcpClientChannelSend {
    public void sendLineUpload(Integer companyId, String boxSn, byte[] lineBytes) {
        byte[] content = new byte[lineBytes.length + 2];
        content[0] = 0x00;
        content[1] = 0x10;
        System.arraycopy(lineBytes, 0, content, 2, lineBytes.length);
        this.sendContent(companyId, boxSn, (byte) 0xD1, content);
    }

    public void sendLineStart(Integer companyId, String boxSn, byte[] lineBytes) {
        byte[] content = new byte[lineBytes.length + 2];
        content[0] = 0x00;
        content[1] = 0x17;
        this.sendContent(companyId, boxSn, (byte) 0xD1, content);
    }

    public void sendLinePause(Integer companyId, String boxSn, byte[] lineBytes) {
        byte[] content = new byte[lineBytes.length + 2];
        content[0] = 0x00;
        content[1] = 0x18;
        this.sendContent(companyId, boxSn, (byte) 0xD1, content);
    }

    public void sendLineResume(Integer companyId, String boxSn, byte[] lineBytes) {
        byte[] content = new byte[lineBytes.length + 2];
        content[0] = 0x00;
        content[1] = 0x19;
        this.sendContent(companyId, boxSn, (byte) 0xD1, content);
    }

    public void sendLineEnd(Integer companyId, String boxSn, byte[] lineBytes) {
        byte[] content = new byte[lineBytes.length + 2];
        content[0] = 0x00;
        content[1] = 0x20;
        this.sendContent(companyId, boxSn, (byte) 0xD1, content);
    }
}
